function dirStr = FindLastMeasurement()

% Returns the directory of the most recent measurement.

dirStr = '\\PC0647\d\data';

while 1
    try
        n = dir(dirStr);
        dSub = [n(:).isdir];
        dirs = {n(dSub).name};
        dirs(ismember(dirs,{'.','..'})) = [];        
        subDirStr = dirs{end};
        dirStr = [dirStr '\' subDirStr];
    catch
        break;
    end
end